package com.eedi.org.healthinfo.dal.mapper;

import com.eedi.framework.common.pojo.PageResult;
import com.eedi.framework.mybatis.core.mapper.BaseMapperX;
import com.eedi.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.eedi.org.healthinfo.controller.vo.OrgHealthInfoGroupPageReqVO;
import com.eedi.org.healthinfo.dal.dataobject.OrgHealthInfoGroupDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 健康资讯分类管理 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface OrgHealthInfoGroupMapper extends BaseMapperX<OrgHealthInfoGroupDO> {

    default PageResult<OrgHealthInfoGroupDO> selectPage(OrgHealthInfoGroupPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OrgHealthInfoGroupDO>()
                .likeIfPresent(OrgHealthInfoGroupDO::getOrgGroupName, reqVO.getOrgGroupName())
                .orderByAsc(OrgHealthInfoGroupDO::getOrgSort));
    }



    default OrgHealthInfoGroupDO selectByName(String groupName) {
        return selectOne(OrgHealthInfoGroupDO::getOrgGroupName, groupName);
    }


}
